<?php

namespace App\Http\Requests\Platform\Setting\WalletTimely;

use App\Http\Requests\Request;
use App\Rules\UriDomain;
use App\Rules\UriPath;

class ItemRequest extends Request
{

    /**
     * 应用于请求的验证规则。
     *
     * @return array
     */
    public function rules()
    {
        return [
            'plat_code' => 'required|string|max:64',
            'config.timeout' => 'required|integer|between:1000,10000',
            'config.baseUrl' => ['required', 'string', 'max:1024', new UriDomain()],
            'config.apis.openWalletBalance.url' => ['required', 'string', 'max:1024', new UriPath()],
            'config.apis.openWalletBet.url' => ['required', 'string', 'max:1024', new UriPath()],
            'config.apis.openWalletCancel.url' => ['required', 'string', 'max:1024', new UriPath()],
        ];
    }

    /**
     * 自定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [];
    }

    /**
     * 自定义字段名称。
     *
     * @return array
     */
    public function attributes()
    {
        return [];
    }
}
